/**
 * Title: jFamilyTree provider
 * Description: jFamilyTree Provider
 * Version: provider
 * Copyright: (c) 2001-2008
 * Terms of use:see license agreement at http://treebolic.sourceforge.net/en/license.htm
 * Author: Bernard Bou
 * Company: bsys
 * Update: Mon Mar 10 00:00:00 CEST 2008
 */
package jFamilyTree.provider.xml.dom;

import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXParseException;

/**
 * Parse error handler
 * 
 * @author Bernard Bou
 */
class ParseErrorHandler implements ErrorHandler
{
	/**
	 * Warning count
	 */
	protected int theWarnings;

	/**
	 * Error count
	 */
	protected int theErrors;

	/**
	 * Fatal error count
	 */
	protected int theFatalErrors;

	/**
	 * Constructor
	 */
	protected ParseErrorHandler()
	{
		theWarnings = 0;
		theErrors = 0;
		theFatalErrors = 0;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException)
	 */
	public void error(SAXParseException e) throws SAXParseException
	{
		theFatalErrors++;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException)
	 */
	public void warning(SAXParseException e) throws SAXParseException
	{
		theWarnings++;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
	 */
	public void fatalError(SAXParseException e) throws SAXParseException
	{
		theFatalErrors++;
	}
}
